//
// Created by 陈奕锟 on 2022/11/20.
//

#ifndef AUTOMATICTELLER_TELLER_MESSAGE_HPP
#define AUTOMATICTELLER_TELLER_MESSAGE_HPP

#endif //AUTOMATICTELLER_TELLER_MESSAGE_HPP
#pragma once

#include <string>

#include "sender.hpp"

struct withdraw
{
    std::string account;
    unsigned amount;
    mutable messaging::sender atm_queue;

    withdraw(std::string const&  i_account, unsigned i_amount, messaging::sender i_atm_queue)
        : account(i_account), amount(i_amount), atm_queue(i_atm_queue)
    {}
};

struct withdraw_ok
{};

struct withdraw_denied
{};

struct cancel_withdrawal
{
    std::string account;
    unsigned amount;

    cancel_withdrawal(std::string const& i_account, unsigned i_amount)
        : account(i_account), amount(i_amount)
    {}
};

struct withdrawal_processed
{
    std::string account;
    unsigned amount;

    withdrawal_processed(std::string const& i_account, unsigned i_amount)
        : account(i_account), amount(i_amount)
    {}
};

struct card_inserted
{
    std::string account;

    explicit card_inserted(std::string const& i_account)
        : account(i_account)
    {}
};

struct digit_pressed
{
    char digit;

    explicit digit_pressed(char i_digit)
        : digit(i_digit)
    {}
};

struct clear_last_pressed
{};

struct eject_card
{};

struct withdraw_pressed
{
    unsigned amount;

    explicit withdraw_pressed(unsigned i_amount)
        : amount(i_amount)
    {}
};

struct cancel_pressed
{};

struct issue_money
{
    unsigned amount;

    explicit issue_money(unsigned i_amount)
        : amount(i_amount)
    {}
};

struct verify_pin
{
    std::string account;
    std::string pin;

    mutable messaging::sender atm_queue;

    verify_pin(
            std::string const& i_account,
            std::string const& i_pin,
            messaging::sender i_atm_queue
            )
        : account(i_account), pin(i_pin), atm_queue(i_atm_queue)
    {}
};

struct pin_verified
{};

struct pin_incorrect
{};

struct display_enter_pin
{};

struct display_enter_card
{};

struct display_insufficient_fonds
{};

struct display_withdrawal_cancelled
{};

struct display_pin_incorrect_message
{};

struct display_withdrawal_options
{};

struct get_balance
{
    std::string account;
    mutable messaging::sender atm_queue;

    get_balance(std::string const& i_account, messaging::sender i_atm_queue)
        : account(i_account), atm_queue(i_atm_queue)
    {}
};

struct balance
{
    unsigned amount;

    explicit balance(unsigned i_amount)
        : amount(i_amount)
    {}
};

struct display_balance
{
    unsigned amount;

    explicit display_balance(unsigned i_amount)
        : amount(i_amount)
    {}
};

struct balance_pressed
{};